﻿CREATE PROCEDURE [acms].[Menu_Delete]
	@Id int, 
	@VersionId timestamp
AS
	Update Menus
	Set Deleted = 1
	Where Id = @Id
		and VersionId = @VersionId
		and Deleted = 0
	
	if @@Rowcount = 0 begin
		if exists (select null from Menu_View where Id = @Id)
			return -100
		else
			return -200
	end
RETURN 0;